Get windows build working #1711
                
     Merged
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Description
Initial PR for #1563. Fixes Windows CMAKE build.
Finally had time to come back to this - build on a fresh Windows11 machine, all steps to setup/reproduce included.
The change to
core/plugins/CMakeLists.txtseems like it should be unrelated to this. I was unable to build because 'cudnn.h' was required, but the include path was not being passed to the compiler as thecuDNNmodule wasn't specified. This might not be a problem in other targets because commonly the cudnn files are just installed in to the cuda include/lib/bin dirs.Also note - windows is generally case insensitive. The normal output dir is
build/but that doesn't work on Windows as there is aBUILDfile. So I'm usingout/as the output. But that isn't in the.gitignore, and I haven't included a change for that in this PR.Type of change
Notes to reproduce with Visual Studio Code (I didn't want to pull down the whole Visual Studio)
cuDNN_ROOT_DIRTensorRT_ROOTTensorRT_ROOT\libto PATHTorch_DIRTorch_DIR\libto PATH.vscode\settings.json/.vscode/settings.json{ "cmake.generator": "Ninja", "cmake.configureSettings": { "CMAKE_MODULE_PATH": { "type": "FILEPATH", "value": "$PWD\\cmake\\Modules" }, "CMAKE_CXX_FLAGS": { "type": "STRING", "value": "-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING" }, "Torch_DIR": { "type": "FILEPATH", "value": "X:\\libtorch\\share\\cmake\\Torch" }, "TensorRT_ROOT": { "type": "FILEPATH", "value": "X:\\path\\to\\tensorrt" }, "cuDNN_ROOT_DIR": { "type": "FILEPATH", "value": "X:\\path\\to\\cudnn" }, "CMAKE_CUDA_FLAGS": "-allow-unsupported-compiler" }, "cmake.buildDirectory": "${workspaceFolder}/out" }